﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Rings.aspx.cs" Inherits="Web.Rings" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">

    <link rel="stylesheet" href="/Share/Styles/Rings.css" />

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="server">

    <asp:UpdatePanel ID="UpdatePanelRings" runat="server">
        <ContentTemplate>

            <section id="Rings" class="inset-shadow box clear-fix">

                <header>
                    <h3>Расписание звонков</h3>
                </header>

                <% if (PermissionService.CanCUDRings())
                   { %>

                <div runat="server" id="EditRingsForm" visible="false" class="form">

                    <div runat="server" id="EditRingsFormError" class="form-error" />

                    <table>
                        <tr>
                            <th>Пара</th>
                            <th>Начало</th>
                            <th>Конец</th>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb1PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb1PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb2PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb2PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb3PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb3PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td>4</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb4PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb4PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td>5</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb5PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb5PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td>6</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb6PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb6PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td>7</td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb7PairBegin" CssClass="timepicker" />
                            </td>
                            <td>
                                <asp:TextBox runat="server" ID="Tb7PairEnd" CssClass="timepicker" />
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2">
                                <asp:Button runat="server" ID="BtnSaveRings" CssClass="button" Text="Сохранить" OnClick="BtnSaveRings_OnClick" />
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2">
                                <asp:Button runat="server" ID="BtnCancel" CssClass="button" Text="Отменить" OnClick="BtnCancel_OnClick" />
                            </td>
                        </tr>
                    </table>
                </div>

                <% } %>

                <div>
                    <asp:ListView runat="server" ID="ListViewRings">

                        <LayoutTemplate>
                            <table class="table-bordered">
                                <thead>
                                    <tr>
                                        <th>Пара</th>
                                        <th>Время</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:PlaceHolder runat="server" ID="ItemPlaceholder"></asp:PlaceHolder>
                                </tbody>
                            </table>
                        </LayoutTemplate>

                        <ItemTemplate>
                            <tr>
                                <td><%# Eval("PairNo") %></td>
                                <td><%# string.Format("{0} - {1}", Eval("BeginTime"), Eval("EndTime")) %></td>
                            </tr>
                        </ItemTemplate>

                    </asp:ListView>

                    <% if (PermissionService.CanCUDRings())
                       {%>
                    <asp:Button runat="server" ID="BtnChangeRings" CssClass="button" Text="Изменить" OnClick="BtnChangeRings_OnClick" />
                    <% } %>
                </div>

            </section>
        </ContentTemplate>

    </asp:UpdatePanel>

</asp:Content>
